package view;





import java.math.*;
import java.util.*;

public class DecryptMessage{
    private String plaintext;    
    private String testtext;        
    public DecryptMessage(BigInteger[] roots){
		for(int i = 0; i<4;i++){
		// verify the message based on the encryption protocol
			byte[] mes = roots[i].toByteArray();
			 testtext = new String(mes,0,(mes.length - 1));			
			 //System.out.println("testtext after decryption : " + testtext);			 
			if( mes[mes.length - 2] == mes[mes.length - 1]){
				 plaintext = new String(mes,0,(mes.length - 1));
				 //System.out.println("Plaintext after decryption : " + plaintext);
				 }
    	}
    
    }
    


// Accessor method for getting the plaintext in main application    
    public String getPlainText() {
		return plaintext;
    }
  
}

